import Vue from 'vue';
import Router from 'vue-router';
import Login from '../views/Login';
import Main from '../views/Main';
import WorkOrder from '../views/workOrder/WorkOrder';
import Resource from '../views/resource/Resource';
import Operation from '../views/operation/Operation';
import Stock from '../views/stock/Stock';
import Statement from '../views/statement/Statement';
import System from '../views/system/System';
import WorkOrderList from '../views/workOrder/WorkOrderList';
import DataCenterList from '../views/resource/dataCenter/DataCenterList';
import RackList from '../views/resource/device/rack/RackList';
import EnclosureList from '../views/resource/device/enclosure/EnclosureList';

Vue.use(Router);

export default new Router({
  routes: [
    {
      name: 'Login',
      path: '/',
      component: Login
    },
    {
      name: 'Main',
      path: '/main',
      component: Main,
      children: [
        {
          name: 'WorkOrder',
          path: 'workOrder',
          component: WorkOrder,
          children: [
            {
              name: 'WorkOrderList',
              path: 'workOrderList/:listType',
              component: WorkOrderList
            }
          ]
        },
        {
          name: 'Resource',
          path: 'resource',
          component: Resource,
          children: [
            {
              name: 'DataCenterList',
              path: 'dataCenterList',
              component: DataCenterList
            },
            {
              name: 'RackList',
              path: 'rackList',
              component: RackList
            },
            {
              name: 'EnclosureList',
              path: 'enclosureList',
              component: EnclosureList
            }
          ]
        },
        {
          name: 'Operation',
          path: 'operation',
          component: Operation
        },
        {
          name: 'Stock',
          path: 'stock',
          component: Stock
        },
        {
          name: 'Statement',
          path: 'statement',
          component: Statement
        },
        {
          name: 'System',
          path: 'system',
          component: System
        }
      ]
    }
  ]
});
